<template>
    <div class="userlistcontainer">
        <h3>用户列表</h3>
        <User :user="item" v-for="item in userlist" :key="item.id"></User>
    </div>
</template>

<script>
    import eventBus from '@/eventBus.js'
    import User from './User.vue'
    export default {
        name:'UserList',
        components:{User},
        data(){
            return {
                userlist:[]
            }
        },
        created(){
            eventBus.$on("list",(data => {
                this.userlist = data;
            }))
        }
    }
</script>

<style>

</style>